﻿@model IEnumerable<ProjectTracker.Library.ResourceAssignmentEdit>

@{
  ViewBag.Title = "Assignments for " + @ViewData["Title"];
}

<h2>@ViewBag.Title</h2>

<p>
    @Html.ActionLink("Add New", "Create", new { resourceId = ViewData["ResourceId"] })
</p>
<table>
    <tr>
        <th></th>
        <th>
            Project
        </th>
        <th>
            Assigned
        </th>
        <th>
            Role
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { projectId = item.ProjectId, resourceId = ViewData["ResourceId"] }) |
            @Html.ActionLink("Delete", "Delete", new { projectId = item.ProjectId, resourceId = ViewData["ResourceId"] })
        </td>
        <td>
            @item.ProjectName
        </td>
        <td>
            @item.Assigned
        </td>
        <td>
            @item.RoleName
        </td>
    </tr>
}

</table>
<div>
  @Html.ActionLink("Back to Resource", "Edit", "Resource", new { id = ViewData["ResourceId"] }, null)
</div>

